"use strict";
// 字符串
var str = 'coderzrf'; // let str: string
str = 'onlyString';
// 数值
var num = 123; // let num: number
num = 999.0;
// 布尔值
var bool = true; // let bool: boolean
bool = false;
// 数组
var arr = ['coderzrf', 24]; // let arr: (string | number)[]
arr.push('string', 0);
// 对象
var obj = { name: 'coderzrf', age: 24 }; // let obj: {name: string; age: number; }
obj.name = 'onlyBeReplacedNameAndAge';
// obj.asc = 'error'; //只能修改已有的属性和方法
// 嵌套对象
var comObj = {
    name: 'coderzrf',
    age: 24,
    asc: {
        gender: 'man',
        hobby: ['coding', true]
    }
};
/* let comObj: {
  name: string;
  age: number;
  asc: {
    gender: string;
    hobby: (string | boolean)[];
  };
} */
// 函数
var func = function () { return "isFunction"; }; //let func: () => string
